import { Scene, ArcRotateCamera, HighlightLayer, Engine, Vector3, AbstractMesh, DirectionalLight } from '@babylonjs/core';

export class World {


    private scene: Scene;
    private camera: ArcRotateCamera;
    private hLayer: HighlightLayer;

    public get Scene() {
        return this.scene;
    }
    public get Camera() {
        return this.camera;
    }

    constructor(engine: Engine, canvas: HTMLCanvasElement) {
        this.scene = new Scene(engine);
        this.camera = new ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, new Vector3(0, 0, 5), this.scene);
        this.hLayer = new HighlightLayer("hl1", this.scene);
        new DirectionalLight('light', new Vector3(1, 1, 1), this.scene);
        this.camera.attachControl(canvas, true, true);
    }
    public render() {
        this.scene.render();
    }

    public setCameraTarget(target: AbstractMesh | Vector3) {
        this.camera.setTarget(target);
    }
    public force() {
        this.camera.focusOn(this.scene.meshes);
    }
    public heightObject() {
        this.hLayer.addExcludedMesh;
    }
}